.class final Llt/farmis/libraries/externalgps/providers/usb/NmeaUSBDevice$autoDisconnecter$1;
.super Ljava/lang/Object;
.source "NmeaUSBDevice.kt"

# interfaces
.implements Ljava/lang/Runnable;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Llt/farmis/libraries/externalgps/providers/usb/NmeaUSBDevice;-><init>(Landroid/hardware/usb/UsbDevice;Landroid/hardware/usb/UsbManager;Llt/farmis/libraries/externalgps/providers/usb/USBDeviceManagerConfigs;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x18
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Llt/farmis/libraries/externalgps/providers/usb/NmeaUSBDevice;


# direct methods
.method constructor <init>(Llt/farmis/libraries/externalgps/providers/usb/NmeaUSBDevice;)V
    .locals 0

    iput-object p1, p0, Llt/farmis/libraries/externalgps/providers/usb/NmeaUSBDevice$autoDisconnecter$1;->this$0:Llt/farmis/libraries/externalgps/providers/usb/NmeaUSBDevice;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public final run()V
    .locals 2

    .line 31
    :goto_0
    iget-object v0, p0, Llt/farmis/libraries/externalgps/providers/usb/NmeaUSBDevice$autoDisconnecter$1;->this$0:Llt/farmis/libraries/externalgps/providers/usb/NmeaUSBDevice;

    invoke-virtual {v0}, Llt/farmis/libraries/externalgps/providers/NMEADeviceManager;->getStatus()Llt/farmis/libraries/externalgps/providers/Status;

    move-result-object v0

    sget-object v1, Llt/farmis/libraries/externalgps/providers/Status;->CONNECTED:Llt/farmis/libraries/externalgps/providers/Status;

    invoke-static {v0, v1}, Lkotlin/jvm/internal/Intrinsics;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_1

    .line 32
    iget-object v0, p0, Llt/farmis/libraries/externalgps/providers/usb/NmeaUSBDevice$autoDisconnecter$1;->this$0:Llt/farmis/libraries/externalgps/providers/usb/NmeaUSBDevice;

    invoke-virtual {v0}, Llt/farmis/libraries/externalgps/providers/usb/NmeaUSBDevice;->getUsbManager()Landroid/hardware/usb/UsbManager;

    move-result-object v0

    invoke-virtual {v0}, Landroid/hardware/usb/UsbManager;->getDeviceList()Ljava/util/HashMap;

    move-result-object v0

    iget-object v1, p0, Llt/farmis/libraries/externalgps/providers/usb/NmeaUSBDevice$autoDisconnecter$1;->this$0:Llt/farmis/libraries/externalgps/providers/usb/NmeaUSBDevice;

    invoke-virtual {v1}, Llt/farmis/libraries/externalgps/providers/usb/NmeaUSBDevice;->getDevice()Landroid/hardware/usb/UsbDevice;

    move-result-object v1

    invoke-virtual {v1}, Landroid/hardware/usb/UsbDevice;->getDeviceName()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/hardware/usb/UsbDevice;

    if-nez v0, :cond_0

    .line 35
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "disconnected USB "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-object v1, p0, Llt/farmis/libraries/externalgps/providers/usb/NmeaUSBDevice$autoDisconnecter$1;->this$0:Llt/farmis/libraries/externalgps/providers/usb/NmeaUSBDevice;

    invoke-virtual {v1}, Llt/farmis/libraries/externalgps/providers/NMEADeviceManager;->getStatus()Llt/farmis/libraries/externalgps/providers/Status;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/Enum;->name()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    const-string v1, "NmeaUSBDevice"

    invoke-static {v1, v0}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 36
    iget-object v0, p0, Llt/farmis/libraries/externalgps/providers/usb/NmeaUSBDevice$autoDisconnecter$1;->this$0:Llt/farmis/libraries/externalgps/providers/usb/NmeaUSBDevice;

    invoke-virtual {v0}, Llt/farmis/libraries/externalgps/providers/usb/NmeaUSBDevice;->disconnect()V

    goto :goto_0

    :cond_0
    const-wide/16 v0, 0x5dc

    .line 38
    invoke-static {v0, v1}, Ljava/lang/Thread;->sleep(J)V

    goto :goto_0

    :cond_1
    return-void
.end method
